//
//  SDShareReportVC.m
//  skinDetection
//
//  Created by  liangzhun on 2018/11/1.
//  Copyright © 2018年  liangzhun. All rights reserved.
//

#import "SDShareReportVC.h"

@interface SDShareReportVC ()

@end

@implementation SDShareReportVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    
    [self.view setHidden:YES];
    
    self.bottom.constant = -(SDBottom_Height + 119);
    
    [self.shareBtn handleControlEvent:UIControlEventTouchUpInside withBlock:^{
        [SDMethodTool shareMsgWithParame:@{@"reportId":self.reportId} ViewController:self];
    }];
    //[self presentShareView];
    
}

/**
 弹出报告的选择框
 */
- (void)presentShareView
{
    [self.view setHidden:NO];
    [UIView animateWithDuration:0.3 animations:^{
        self.bottom.constant = -SDBottom_Height;
         [self.view layoutIfNeeded];
    }];
   
}

/**
 移除报告选择框
 */
- (void)dismissShareView
{
    [UIView animateWithDuration:0.15 animations:^{
       self.bottom.constant = -(SDBottom_Height + 119);
         [self.view layoutIfNeeded];
    } completion:^(BOOL finished) {
        [self.view setHidden:YES];
    }];
  
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint point = [touch locationInView:self.view];
    if (point.y < SDMainScreenHeight - 119) {
        [self dismissShareView];
    }
 
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/


@end
